package com.andox.fn.inf.rpc.rest;

import java.io.Serializable;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;

/**   
 * @ClassName:   RpcRequest   
 * @Description: TODO  
 * @author:      Andox
 * @date:        2019年7月29日 下午1:29:25   
 *     
 */
public class RpcRequest implements Serializable{
	private static final long serialVersionUID = 836844699473599324L;
	public static final int HEART_BEAT_TYPE = 1;
	public static final int BIZ_TYPE = 2;
	
	private final static AtomicLong requestId = new AtomicLong(1);
	
	private long opaque;
	private int type;
	private String method;
	private String[] paraTypes;
	private String uniqueId;
	private String source;
	private String data;
	
	private Map<String, String> sysProperties;
	
	/**
	 * @return the data
	 */
	public String getData() {
		return data;
	}
	/**
	 * @param data the data to set
	 */
	public void setData(String data) {
		this.data = data;
	}
	/**
	 * @return the source
	 */
	public String getSource() {
		return source;
	}
	/**
	 * @param source the source to set
	 */
	public void setSource(String source) {
		this.source = source;
	}
	/**
	 * @return the uniqueId
	 */
	public String getUniqueId() {
		return uniqueId;
	}
	/**
	 * @param uniqueId the uniqueId to set
	 */
	public void setUniqueId(String uniqueId) {
		this.uniqueId = uniqueId;
	}
	/**
	 * @return the serialversionuid
	 */
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	/**
	 * @return the type
	 */
	public int getType() {
		return type;
	}
	/**
	 * @param type the type to set
	 */
	public void setType(int type) {
		this.type = type;
	}
	/**
	 * @return the opaque
	 */
	public long getOpaque() {
		return opaque;
	}
	/**
	 * @param opaque the opaque to set
	 */
	public void setOpaque(long opaque) {
		this.opaque = opaque;
	}
	
	/**
	 * @return the method
	 */
	public String getMethod() {
		return method;
	}
	/**
	 * @param method the method to set
	 */
	public void setMethod(String method) {
		this.method = method;
	}
	public String[] getParaTypes() {
		return paraTypes;
	}
	public void setParaTypes(String[] paraTypes) {
		this.paraTypes = paraTypes;
	}
	public Map<String, String> getSysProperties() {
		return sysProperties;
	}
	public void setSysProperties(Map<String, String> sysProperties) {
		this.sysProperties = sysProperties;
	}
	public static RpcRequest newInstanceWithId() {
		RpcRequest ar = new RpcRequest();
		ar.setOpaque(requestId.getAndIncrement());
		
		return ar;
	}
}
